import 'package:flutter/material.dart';
import 'package:app_core/src/utils/screen_adapter.dart';
import 'colors.dart';

// FontWeight.w100 = FontWeight.thin        // 极细
// FontWeight.w200 = FontWeight.extraLight // 超细
// FontWeight.w300 = FontWeight.light      // 细体
// FontWeight.w400 = FontWeight.normal     // 正常/常规
// FontWeight.w500 = FontWeight.medium     // 中等
// FontWeight.w600 = FontWeight.semiBold   // 半粗
// FontWeight.w700 = FontWeight.bold       // 粗体
// FontWeight.w800 = FontWeight.extraBold // 超粗
// FontWeight.w900 = FontWeight.black      // 黑体

///📢📢📢项目中的样式颜色都用配置文件管里起来，业务代码中不允许硬编码编写简写含义的颜色和样式
///统一管理，样式项目全局统一，便于后期全局维护和修改
abstract class AppStyles {
  /// 基础文字样式 - 使用 sp 支持屏幕适配
  static TextStyle get s10 => TextStyle(fontSize: 10.sp, fontWeight: FontWeight.normal);
  static TextStyle get s12 => TextStyle(fontSize: 12.sp, fontWeight: FontWeight.normal);
  static TextStyle get s14 => TextStyle(fontSize: 14.sp, fontWeight: FontWeight.normal);
  static TextStyle get s16 => TextStyle(fontSize: 16.sp, fontWeight: FontWeight.normal);
  static TextStyle get s17 => TextStyle(fontSize: 17.sp, fontWeight: FontWeight.normal);
  static TextStyle get s18 => TextStyle(fontSize: 18.sp, fontWeight: FontWeight.normal);
  static TextStyle get s20 => TextStyle(fontSize: 20.sp, fontWeight: FontWeight.normal);
  static TextStyle get s24 => TextStyle(fontSize: 24.sp, fontWeight: FontWeight.normal);
  static TextStyle get s28 => TextStyle(fontSize: 28.sp, fontWeight: FontWeight.normal);
  static TextStyle get s30 => TextStyle(fontSize: 30.sp, fontWeight: FontWeight.normal);
  static TextStyle get s32 => TextStyle(fontSize: 32.sp, fontWeight: FontWeight.normal);
  static TextStyle get s34 => TextStyle(fontSize: 34.sp, fontWeight: FontWeight.normal);
  static TextStyle get s40 => TextStyle(fontSize: 40.sp, fontWeight: FontWeight.normal);
  static TextStyle get s48 => TextStyle(fontSize: 48.sp, fontWeight: FontWeight.normal);

  /// 中等粗细样式
  static TextStyle get s10w5 => TextStyle(fontSize: 10.sp, fontWeight: FontWeight.w500);
  static TextStyle get s12w5 => TextStyle(fontSize: 12.sp, fontWeight: FontWeight.w500);
  static TextStyle get s14w5 => TextStyle(fontSize: 14.sp, fontWeight: FontWeight.w500);
  static TextStyle get s16w5 => TextStyle(fontSize: 16.sp, fontWeight: FontWeight.w500);
  static TextStyle get s17w6 => TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w500);
  static TextStyle get s18w5 => TextStyle(fontSize: 18.sp, fontWeight: FontWeight.w500);
  static TextStyle get s20w5 => TextStyle(fontSize: 20.sp, fontWeight: FontWeight.w500);
  static TextStyle get s30w5 => TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w500);
  static TextStyle get s32w5 => TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500);
  static TextStyle get s40w5 => TextStyle(fontSize: 40.sp, fontWeight: FontWeight.w500);

  /// 加粗样式
  static TextStyle get s10b => TextStyle(fontSize: 10.sp, fontWeight: FontWeight.bold);
  static TextStyle get s12b => TextStyle(fontSize: 12.sp, fontWeight: FontWeight.bold);
  static TextStyle get s14b => TextStyle(fontSize: 14.sp, fontWeight: FontWeight.bold);
  static TextStyle get s16b => TextStyle(fontSize: 16.sp, fontWeight: FontWeight.bold);
  static TextStyle get s18b => TextStyle(fontSize: 18.sp, fontWeight: FontWeight.bold);
  static TextStyle get s17b => TextStyle(fontSize: 17.sp, fontWeight: FontWeight.bold);
  static TextStyle get s20b => TextStyle(fontSize: 20.sp, fontWeight: FontWeight.bold);
  static TextStyle get s24b => TextStyle(fontSize: 24.sp, fontWeight: FontWeight.bold);
  static TextStyle get s28b => TextStyle(fontSize: 28.sp, fontWeight: FontWeight.bold);
  static TextStyle get s34b => TextStyle(fontSize: 34.sp, fontWeight: FontWeight.bold);

  ///📢📢📢📢 可以在这维护项目中主要常用样式
  /// 文字样式 - 复用基础颜色
  static TextStyle get s16Primary => s16.copyWith(color: AppColor.primary);
  static TextStyle get s16White => s16.copyWith(color: AppColor.white);
  static TextStyle get s16Black => s16.copyWith(color: AppColor.black);
  static TextStyle get s16Green => s16.copyWith(color: AppColor.success);
  static TextStyle get s16Red => s16.copyWith(color: AppColor.error);
  static TextStyle get s16Blue => s16.copyWith(color: AppColor.info);
  static TextStyle get s16Grey => s16.copyWith(color: AppColor.textSecondary);

  /// 加粗样式 - 复用基础颜色
  static TextStyle get s18bPrimary => s18b.copyWith(color: AppColor.primary);
  static TextStyle get s18bWhite => s18b.copyWith(color: AppColor.white);
  static TextStyle get s18bBlack => s18b.copyWith(color: AppColor.black);
  static TextStyle get s18bGreen => s18b.copyWith(color: AppColor.success);
  static TextStyle get s18bRed => s18b.copyWith(color: AppColor.error);
  static TextStyle get s18bBlue => s18b.copyWith(color: AppColor.info);
  static TextStyle get s18bGrey => s18b.copyWith(color: AppColor.textSecondary);

  /// 中等粗细样式 - 复用基础颜色
  static TextStyle get s16w5Primary => s16w5.copyWith(color: AppColor.primary);
  static TextStyle get s16w5White => s16w5.copyWith(color: AppColor.white);
  static TextStyle get s16w5Black => s16w5.copyWith(color: AppColor.black);
  static TextStyle get s16w5Green => s16w5.copyWith(color: AppColor.success);
  static TextStyle get s16w5Red => s16w5.copyWith(color: AppColor.error);
  static TextStyle get s16w5Blue => s16w5.copyWith(color: AppColor.info);
  static TextStyle get s16w5Grey => s16w5.copyWith(color: AppColor.textSecondary);



  /// --------------📢⚠️项目特定的语义化样式--------------------------------
  /// 修改这里即可修改组件样式
  static TextStyle get textFieldStyle => s16.copyWith(color: AppColor.textPrimary);
  static TextStyle get textFieldHintStyle => s16.copyWith(color: AppColor.textHint);
  static TextStyle get navTitleStyle => s17b.copyWith(color: AppColor.textPrimary);
}

abstract class AppSpaces {
  /// ===== 基础间距（语义化）=====
  static const double xs = 4.0; // 极小间距
  static const double sm = 8.0; // 小间距
  static const double md = 16.0; // 中等间距
  static const double lg = 24.0; // 大间距
  static const double xl = 32.0; // 超大间距
  static const double xxl = 48.0; // 极大间距

  /// ===== 常用圆角（语义化）=====
  static const double radiusXs = 4.0; // 极小圆角
  static const double radiusSm = 8.0; // 小圆角
  static const double radiusMd = 12.0; // 中等圆角
  static const double radiusLg = 16.0; // 大圆角
  static const double radiusXl = 24.0; // 超大圆角

  static const EdgeInsets edgeXs = EdgeInsets.all(xs);
  static const EdgeInsets edgeSm = EdgeInsets.all(sm);
  static const EdgeInsets edgeMd = EdgeInsets.all(md);
  static const EdgeInsets edgeLg = EdgeInsets.all(lg);
  static const EdgeInsets edgeXl = EdgeInsets.all(xl);

  static const BorderRadius borderRadiusXs = BorderRadius.all(Radius.circular(radiusXs));
  static const BorderRadius borderRadiusSm = BorderRadius.all(Radius.circular(radiusSm));
  static const BorderRadius borderRadiusMd = BorderRadius.all(Radius.circular(radiusMd));
  static const BorderRadius borderRadiusLg = BorderRadius.all(Radius.circular(radiusLg));
  static const BorderRadius borderRadiusSL = BorderRadius.all(Radius.circular(radiusXl));
}

/// 简化间距组件
abstract class SpaceBox {
  /// 垂直间距
  static const SizedBox h4 = SizedBox(height: 4);
  static const SizedBox h8 = SizedBox(height: 8);
  static const SizedBox h12 = SizedBox(height: 12);
  static const SizedBox h16 = SizedBox(height: 16);
  static const SizedBox h20 = SizedBox(height: 20);
  static const SizedBox h24 = SizedBox(height: 24);
  static const SizedBox h32 = SizedBox(height: 32);

  /// 水平间距
  static const SizedBox w4 = SizedBox(width: 4);
  static const SizedBox w8 = SizedBox(width: 8);
  static const SizedBox w12 = SizedBox(width: 12);
  static const SizedBox w16 = SizedBox(width: 16);
  static const SizedBox w20 = SizedBox(width: 20);
  static const SizedBox w24 = SizedBox(width: 24);
  static const SizedBox w32 = SizedBox(width: 32);

  /// 动态间距
  static SizedBox vertical(double height) => SizedBox(height: height);
  static SizedBox horizontal(double width) => SizedBox(width: width);

  ///空白格
  static const SizedBox shrink = SizedBox.shrink();
}
